//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __ELASTOS_INIT_H__
#define __ELASTOS_INIT_H__

typedef enum KernelState {
    KernelState_Chaos,
    KernelState_Setup,
    KernelState_Initialize,
    KernelState_Startup,
} KernelState;

EXTERN KernelState g_kernelState;

EXTERN_C DECL_CODEINIT void CDECL SetupCPU();

EXTERN_C DECL_CODEINIT void CDECL SetupMMU(
        physaddr_t paKernelPhysBase, physaddr_t paKernelImagePhysBase,
        physaddr_t paMemoryMappedIoBase, physaddr_t paMemoryMappedIoLimit);

EXTERN DECL_CODEINIT bool_t CDECL InitInterrupts();

EXTERN DECL_CODEINIT bool_t CDECL InitKernelMapping(
        uint_t uBasePageNo, uint_t uLimitPageNo);

EXTERN DECL_CODEINIT bool_t CDECL InitProxyEntryTable();

EXTERN DECL_CODEINIT bool_t CDECL InitUserEntryTable();

EXTERN DECL_CODEINIT bool_t CDECL InitPhysicalMemory();

EXTERN DECL_CODEINIT PageTabEntry * CDECL AllocKernelPageTable();

EXTERN DECL_CODEINIT bool_t CDECL InitTime();

EXTERN DECL_CODEINIT bool_t CDECL InitThread0();

EXTERN DECL_CODEINIT bool_t CDECL InitHAT();

EXTERN DECL_CODEINIT bool_t CDECL InitThreads();

EXTERN DECL_CODEINIT void SwitchToThread0();

EXTERN DECL_CODEINIT bool_t InitGdbStub();

EXTERN DECL_CODEINIT bool_t CDECL InitDrivers();

EXTERN DECL_CODEINIT bool_t InitPeriodicTasks();

EXTERN DECL_CODEINIT bool_t InitSchedule();

EXTERN DECL_CODEINIT bool_t StartPeriodicTasks();

EXTERN DECL_CODEINIT void CDECL InitSystemCallTable();

EXTERN DECL_CODEINIT bool_t CDECL InitCrust();

EXTERN DECL_CODEINIT bool_t CDECL InitMantle();

EXTERN DECL_CODEINIT void InitDelayParameter();

#endif //__ELASTOS_INIT_H__
